package LogServer.constants

import LogServer.utils.PropertiesUtil

/**
  * Created by root on 17-2-21.
  */
// 私有构造方法
class PropertiesStreaming private() {

}

// 伴生对象，与类共享名字，可以访问类的私有属性和方法
object PropertiesStreaming{
  /**
    * get streaming  timespan in properties
    * @return per second
    */
  def getTimespan(): Long = {
    val propertiesUtil = new PropertiesUtil()
    val resource = propertiesUtil.loadResources("streaming.properties")
    val path = propertiesUtil.getString("path",resource)
    val timespanProperties = propertiesUtil.loadProperties(path)
    val timespan = propertiesUtil.getString("timespan",timespanProperties)
    timespan.toLong
  }

  def main(args: Array[String]): Unit = {
    println(getTimespan())
  }
}